
#include "PixelCoords.h"


using namespace Iride;

PixelCoords::PixelCoords(): x(0),y(0)
{
};

PixelCoords::PixelCoords(int ix, int iy): x(ix),y(iy)
{
};

PixelCoords PixelCoords::operator- (void) const
{
	PixelCoords result;
	result.x = - x;
	result.y = - y;

	return result;
}

PixelCoords PixelCoords::operator+ (const PixelCoords& vec) const
{
	PixelCoords result;
	result.x = x + vec.x;
	result.y = y + vec.y;

	return result;
}

PixelCoords PixelCoords::operator- (const PixelCoords& vec) const
{
	PixelCoords result;
	result.x = x - vec.x;
	result.y = y - vec.y;

	return result;
}

PixelCoords PixelCoords::operator* (const float& coeff) const
{
	PixelCoords result;
	result.x = coeff*x;
	result.y = coeff*y;

	return result;
}

PixelCoords PixelCoords::operator/ (const float& coeff) const
{
	PixelCoords result;
	result.x = x/coeff;
	result.y = y/coeff;

	return result;
}

PixelCoords& PixelCoords::operator+= (const PixelCoords& vec)
{
  *this = *this + vec;
  return *this;
}

PixelCoords& PixelCoords::operator-= (const PixelCoords& vec)
{
  *this = *this - vec;
  return *this;
}

const PixelCoords PixelCoords::Zero = PixelCoords(0,0);
